//
//  CommonFunctions.h
//  Yemao
//
//  Created by team on 12-5-24.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface CommonFunctions : NSObject

/*年月日转换成指定日期格式,间隔符必须一样*/
+(NSString *)nianYueRiStringConvertDateString:(NSString *)strDate withFormatter:(NSString *)withFormatter;

//正则验证email
+ (BOOL)validateEmail:(NSString *)email;

//NSDate转换给定格式的string并指定截取位置
+ (NSString *)convertDate:(NSDate *)date withFormatter:(NSString *)withFormatter subFromIndex:(int)subIndex;

/*
 刚刚
 *分钟前
 *小时前
 *天前
 *(*)月**日
 ****年**月**日
 */
+ (NSString *)intervalSinceNow:(int)intDate;

/*
 上午**:**
 下午**:**
 **月**日 **:**
 ****年**月**日 **:**
 */
+ (NSString *)intervalSinceNowChating:(int)intDate;

/*
 刚刚
 *分钟
 *小时
 *天
 m(m)/dd
 yyyy/mm/dd
 */
+(NSString *)intervalSinceNowUserInfo:(int)intDate;

/*
 今天 hh:mm
 mm月dd日 hh:mm
 yyyy年mm月dd hh:mm
 */
+(NSString *)timeWithTodayOrYearMonthDayHoursMinutes:(int)intDate;

/*
 ****-**-**
 */
+ (NSString *)timeWithYearMonthDay:(int)intDate;

/*
 月日小时分钟获得指定格式的时间
 */
+ (NSString *)timeWithMonthDayHoursPoints:(int)intDate;
/*
 年月日小时分钟获得指定格式的时间
 */
+ (NSString *)timeWithYearMonthDayHoursMinutes:(int)intDate formatter:(NSString *)yearMonthDayHoursMinutes;

/*
 获取星期1-7
 */
+ (NSUInteger)getWeekdayFromDate:(NSDate *)date;

+ (void)transformBtn:(UIButton *)theButton withAngle:(CGFloat)angle;
+ (void)transformtoOriginalBtn:(UIButton *)theButton;
+ (UIImage *)scaleImage:(UIImage *)img size:(CGSize)size;
+ (UIImage *)imageFromColor:(UIColor *)color imageSize:(CGSize)imageSize;

+ (void)setButtonImageWithButton:(UIButton*) button iamgePathUrl:(NSString*)urlString;

@end
